<style>
	.alinkStyle{
		display: inline-block;
		margin: 0 15px 12px 0;
		color: #999;
		line-height: 1;
	}
</style>

<div panel panel-default corner-radius panel-hot-topics">
	<div class="panel-heading">
		<h3 class="panel-title"><i class="fa fa-bars"></i> 联系站长</h3>
	</div>
	<div class="panel-body" style="text-align: center;">
		<img src="/dist/images/contact.jpeg" alt="Mhtclub">
	</div>
</div>


<div class="hidden-xs panel panel-default corner-radius panel-hot-topics">
	<div class="panel-heading">
		<h3 class="panel-title"><i class="fa fa-bars"></i> 你可能感兴趣</h3>
	</div>
	<div class="panel-body">
		<ul class="list" id="latests">
			<img src="${base}/dist/images/spinner.gif">
		</ul>
	</div>
</div>
<div class="panel panel-default corner-radius panel-hot-topics">
	<div class="panel-heading">
		<h3 class="panel-title"><i class="fa fa-area-chart"></i> 友情链接</h3>
	</div>
	<div class="panel-body">
		<ul class="list" id="friendUrls">
			<#--<a class="alinkStyle" target="_blank" href="https://wpjam.com/speed/">WordPress 加速优化服务</a>-->
			<a class="alinkStyle" href="https://lbjheiheihei.xyz/">伪君子的梦呓</a>
			<a class="alinkStyle" href="http://liujinkai.com/">凯凯刘</a>
			<a class="alinkStyle" href="https://www.growthhk.cn/">增长黑客</a>
			<a class="alinkStyle" href="https://growthhacker.im/">增长黑客-小象</a>
			<a class="alinkStyle" href="https://www.doudaily.com">抖参谋</a>
			<a class="alinkStyle" href="https://www.doudada.com">抖大大</a>
			<a class="alinkStyle" href="http://xingyue.artizen.me/">星月主题</a>
			<a class="alinkStyle" href="https://www.baiyangseo.com/">白杨SEO学习博客</a>
			<a class="alinkStyle" href="https://www.hellobtc.com/">白话区块链</a>
			<a class="alinkStyle" href="http://www.ityouknow.com">纯洁的微笑</a>
			<a class="alinkStyle" href="https://ads.org.cn/portal.php">赚客吧</a>
			<a class="alinkStyle" href="http://lijinma.com/">金马的Blog</a>
			<a class="alinkStyle" href="https://mrdear.cn/">屈定's Blog</a>
			<a class="alinkStyle" href="https://www.javaboy.org/">江南一点雨</a>
			<a class="alinkStyle" href="https://fookwood.com">闷瓜蛋子的博客</a>
			<a class="alinkStyle" href="http://www.justdojava.com">Java极客技术</a>
			<a class="alinkStyle" href="http://www.jiangxinlingdu.com/">匠心零度博客</a>
			<a class="alinkStyle" href="http://blog.itmyhome.com/">麦田技术博客</a>
			<a class="alinkStyle" href="http://www.wdk.pw">王登科-DK博客</a>
			<a class="alinkStyle" href="http://cxytiandi.com/">猿天地</a>
			<a class="alinkStyle" href="http://blog.csdn.net/rickiyeat">rickiyeat的博客</a>
			<a class="alinkStyle" href="http://cmsblogs.com/">cmsblogs</a>
			<a class="alinkStyle" href="https://blog.52itstyle.vip">小柒博客</a>
			<a class="alinkStyle" href="http://www.liuyue.ren/">六月</a>
			<a class="alinkStyle" href="http://relatos.top/">荒蛮故事</a>
		</ul>
	</div>
</div>
<div class="panel panel-default corner-radius panel-hot-topics">
	<div class="panel-heading">
		<h3 class="panel-title"><i class="fa fa-area-chart"></i> 热门文章</h3>
	</div>
	<div class="panel-body">
		<ul class="list" id="hots">
			<img src="${base}/dist/images/spinner.gif">
		</ul>
	</div>
</div>

<@controls name="comment">
<div class="panel panel-default corner-radius panel-hot-topics">
    <div class="panel-heading">
        <#--<h3 class="panel-title"><i class="fa fa-comment-o"></i> 最新评论</h3>-->
		<h3 class="panel-title"><i class="fa fa-users"></i> 热门用户</h3>
    </div>
    <div class="panel-body">
        <ul class="list" id="comments">
            <img src="${base}/dist/images/spinner.gif">
        </ul>
    </div>
</div>
</@controls>


<script type="text/javascript">

var li_template = '<li>{0}. <a href="${base}/post/{1}">{2}</a></li>';

<#--var comment_li_template = '<li><a href="${base}/post/{0}">{1}</a></li>'-->
<#--var hotuser_li_template = '<li><a href="${base}/user/{0}"><img src="{1}" alt="{2}"></img></a></li>'-->
var hotuser_li_template = '<div style="display: inline-block;margin-left: 6px;margin-top: 6px;">' +
		'<a href="${base}/users/{0}"><img src="{1}" style="width: 70px;border-radius: 50%;"></img></a></div>';

var hotTag_li_template = '<div style="display: inline-block;margin: 0 5px 5px 0;padding: 4px 12px;font-size: 12px!important;font-size: .12rem!important;' +
		'line-height: 1.2;color: #666;border: 1px solid #999;border-radius: 3px;text-decoration: none;">' +
		'<a href="${base}/tag/{1}">{1}({2})</a></div>';
seajs.use('sidebox', function (sidebox) {
	sidebox.init({
        <#--latestUrl : '${base}/api/latests',-->
		latestUrl : '${base}/api/tags',
    	hotUrl : '${base}/api/hots',
		hotTagUrl : '${base}/api/hot_tags',
		latestCommentUrl:'${base}/api/hot_users',
		<#--latestCommentUrl:'${base}/api/latest_comments',-->

        size :9,
        // callback
        onLoadHot : function (i, data) {
      		return jQuery.format(li_template, i + 1, data.id, data.title);
        },
        onLoadLatest : function (i, data) {
      		return jQuery.format(hotTag_li_template, i + 1, data.name, data.posts);
        },
		// onLoadLatest : function (i, data) {
		// 	return jQuery.format(li_template, i + 1, data.id, data.title);
		// },
        // onLoadLatestComment : function (i, data) {
      	// 	return jQuery.format(comment_li_template, data.id, data.avatar, data.username);
        // },
		onLoadLatestComment : function (i, data) {
			return jQuery.format(hotuser_li_template, data.id, data.avatar, data.username);
		}
	});
});
</script>